package Chapter06;

/**
 * Java虚拟机将线程优先级分成10级,从min_priority（1）到max_priority（10）;
 * 对于main线程,它的优先级是NORM_proority(5),最好不要调整线程的优先级,因为
 * 调度器总是会优先运行这个几个线程,如果几个优先级的线程不会停止,则优先级较低的线程
 * 是不会得到运行的.
 * Created by a on 2017/6/11.
 */
public class Test127 {

    public static void main(String[] args) {

       Thread thread = new Thread(new Runnable() {
           @Override
           public void run() {
               System.out.println("11");
           }
       });

       thread.setPriority(2);
       thread.start();
        System.out.println(thread.getThreadGroup());
        System.out.println(Thread.currentThread().getThreadGroup());
        System.out.println(thread.getContextClassLoader());
        System.out.println(thread.getPriority());
        System.out.println(thread.getState());
        System.out.println(thread.getName());
        System.out.println(Thread.currentThread().getPriority());

    }
}
